package com.zt.bus.www.controller;

import java.util.UUID;

import net.sf.json.JSONObject;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.zt.servlet.ReqBean;
import com.zt.servlet.RequestAttribute;
import com.zt.servlet.Response;
import com.zt.util.PropertiesUtil;

@Controller
@RequestMapping(value = "/www")
public class WebSiteController {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    
    @RequestMapping(value = "/setting")
    @ResponseBody
    public JSONObject setting(@RequestAttribute(ReqBean.NAME) ReqBean reqBean) {
    	JSONObject setting = new JSONObject();
    	setting.put("appId", UUID.randomUUID().toString());
    	String ucPath = PropertiesUtil.getProperty("user.center.path");
    	setting.put("imgCaptchaUrl", ucPath + PropertiesUtil.getProperty("user.center.imgCaptchaUrl"));
    	setting.put("smsCaptchaUrl", ucPath + PropertiesUtil.getProperty("user.center.smsCaptchaUrl"));
    	setting.put("registerUrl", ucPath + PropertiesUtil.getProperty("user.center.registerUrl"));
    	setting.put("loginUrl", ucPath + PropertiesUtil.getProperty("user.center.loginUrl"));
    	setting.put("userInfoUrl", ucPath + PropertiesUtil.getProperty("user.center.userInfoUrl"));
    	setting.put("updateUrl", ucPath + PropertiesUtil.getProperty("user.center.updateUrl"));
    	setting.put("forgetPasswordUrl", ucPath + PropertiesUtil.getProperty("user.center.forgetPasswordUrl"));
    	setting.put("updatePasswordUrl", ucPath + PropertiesUtil.getProperty("user.center.updatePasswordUrl"));
    	return Response.responseSuccess(setting);
    }
}
